<template>
  <a-table
    ref="table"
    size="middle"
    bordered
    rowKey="id"
    :columns="columns"
    :dataSource="dataSource"
    :pagination="ipagination"
    :loading="loading"
    @change="handleTableChange"
    class="antableClass"
  ></a-table>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
  props: {
    list: {
      type: String,
      default: ''
    },
    columns: {
      type: Array,
      default: []
    },
    param: {
      type: Object,
      default: () => ({
        orgId: '',
        proId: ''
      })
    },
    reload: {
      type: Boolean,
      default: false
    }
  },
  mixins: [JeecgListMixin],
  beforeMount() {
    this.url.list = this.list
    this.queryParam = Object.assign({}, this.param)
  },
  watch: {
    reload: {
      handler() {
        this.queryParam = Object.assign({}, this.param)
        if (this.queryParam.orgId != '' && this.queryParam.arrayTime.length > 0) {
          this.url.list = this.list
          this.loadData(1)
        } 
      },
      immediate:true
    },
    
  },
  data() {
    return {
      //   disableMixinCreated: true
      url: {
        list: ''
      },
      disableMixinCreated: true
    }
  }
}
</script>

<style lang="less" scoped>
@import '~@assets/less/tableTheme.less';
</style>
